#include "trap.h"

char buf[128];

int main() {

	sprintf(buf, "cda%s", "Hello world!\n");
	
	nemu_assert(strcmp(buf, "cdaHello world!\n") == 0);
	
	sprintf(buf, "%d + %d = %d\n", 12, 1, 2);
	nemu_assert(strcmp(buf, "12 + 1 = 2\n") == 0);
	
	sprintf(buf, "%d + %d = %d\n", 2, 10, 12);
	nemu_assert(strcmp(buf, "2 + 10 = 12\n") == 0);

	sprintf(buf, "%d + %d = %d : %c\n", 2, 10, 12,'H');
	nemu_assert(strcmp(buf, "2 + 10 = 12 : H\n") == 0);

	return 0;
}
